﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Soleil.Domain.ebrary;

namespace GreenGrassland
{
    public class MyDbContext : DbContext
    {
        public MyDbContext(string connectionString) : base(connectionString)
        {
            
        }

        public DbSet<Book> Books { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Book>().ToTable("ebooks");
            modelBuilder.Entity<Book>().HasKey(l => l.Id).Property(l => l.BookName);
            //base.OnModelCreating(modelBuilder);
        }
    }
}
